package main

import (
	"chitchat_http/model"
	"chitchat_http/route"
	"chitchat_http/server"
	"fmt"
	"github.com/doujunyu/gogo/gogo"
	_ "github.com/joho/godotenv/autoload"
	_ "github.com/lib/pq"
	"os"
)

func main() {
	r := gogo.ReadyGo()
	if err := model.PgSqlLine(); err != nil {
		fmt.Println(err)
		return
	}
	if err := model.RedisLine(); err != nil {
		fmt.Println(err)
		return
	}
	route.Route(r)
	go server.TcpWorkByPull()//处理聊天队列中的数据
	r.Run(os.Getenv("SERVER_PORT"),3)

}
